<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.lenovo.server.weixin.CoreService"%>
<%@page import="com.lenovo.server.weixin.util.*"%>
<%@page import="org.apache.log4j.*"%>


<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<%
		Logger  mLog = Logger.getLogger("DealWeixinRequest");
		String signature = request.getParameter("signature");
		String timestamp = request.getParameter("timestamp");
		String nonce = request.getParameter("nonce");
		String echostr = request.getParameter("echostr");
		mLog.info(
				"signature " +signature +
				" timestamp" + timestamp + 
				" nonce " + nonce + 
				" echostr " + echostr
				);
				
	//	if (SignUtil.checkSignature(signature, timestamp, nonce)) {
		if (echostr!=null) {
			out.print(echostr);
			out.flush();
			return;
		}
 %>

<%

String str = CoreService.processRequest(request);
out.println(str);
 %>

